/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ac.za.cput.xalisa.designpatterns.creational.singleton;

/**
 *
 * @author Enkosi
 */
public class Singleton {

    private static Singleton theOnlyOne;
    private Student student = new Student();

    private Singleton() {
    }

    public synchronized static Singleton instance() {
        if (theOnlyOne == null) {
            theOnlyOne = new Singleton();
        }
        return theOnlyOne;
    }

    public Student getStudent() {
        return student;
    }
}
